export default {
  state: {
    modules: [],
    menus: [],
    labels: [],
    nav: {
      current: '',
      back: ''
    }
  },
  getters: {
    getModules: (state) => {
      return state.modules;
    },
    getMenus: (state) => {
      return state.menus;
    },
    getLabels: (state) => {
      return state.labels;
    },
    getNav: (state) => {
      return state.nav;
    }
  },
  mutations: {
    setNav: (state, payload) => {
      state.nav.current = payload.current;
      state.nav.back = payload.back;
    },
    setModules: (state, payload) => {
      state.modules = payload;
    },
    setMenus: (state, payload) => {
      state.menus = payload;
    },
    setLabels: (state, payload) => {
      state.labels = payload;
    },
    clearAccess: (state) => {
      state.modules.length = 0;
      state.menus.length = 0;
      state.labels.length = 0;
    }
  }
};
